-
Notifications
You must be signed in to change notification settings - Fork 5.9k
fix(ci): correctly download npm/docker artifacts #4995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✨ code-server docs for PR #4995 is ready! It will be updated on every commit.
|
Codecov Report
@@ Coverage Diff @@
## main #4995 +/- ##
=======================================
Coverage 71.58% 71.58%
=======================================
Files 29 29
Lines 1675 1675
Branches 373 373
=======================================
Hits 1199 1199
Misses 405 405
Partials 71 71 Continue to review full report at Codecov.
|
Testing NotesHappy I tested this. The current approach didn't work 🤔 https://github.com/jsjoeio/code-server/runs/5562477153?check_suite_focus=true#step:3:11 Did some debugging with @code-asher - when we SuccessThis worked: https://github.com/jsjoeio/code-server/runs/5562662740?check_suite_focus=true#step:3:16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there's a way that it can match branches like release-*
:
with:
branch: release-*
so that it doesn't rely on creating and deleting the same release
branch over and over again.
🤔
Doesn't seem like it from what I can tell, but there is an open PR from January: dawidd6/action-download-artifact#107 but it's only for artifact names :/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to make changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🎉 🎉
* fix(ci): correctly download npm artifact * fixup! fix(ci): correctly download npm artifact * docs: update MAINTAINING * fixup! docs: update MAINTAINING * fixup! Merge branch 'main' into 4949-chore-fix-npm-workflow * chore: get ci to run * refactor: use vVERSION branch name instead of release * refactor: use new download artifact in docker workflow * refactor: clean up release-github-assets script * fixup: remove extra v * fixup! fixup: remove extra v
Context
This PR fixes the npm and docker workflows that runs on a release to correctly download artifacts so it can publish it to the npm and Docker registries.
https://github.com/coder/code-server/blob/main/.github/workflows/npm-brew.yaml#L21-L37
Problem
The default
download-artifact
assumes that you're downloading artifacts from the running workflow. The problem isnpm-brew.yaml
runs onreleased
events.Example: maintainer creates release branch
v4.1.0
➡️ opens PR ➡️ team approves PR ➡️ maintainer merges PR intomain
➡️npm
job fromnpm-brew.yaml
and thedocker.yaml
workflows kick off.Therefore this workflow is not associated with any PR or any commit, but rather a GitHub event.
Solution
Download
npm-release
artifact andrelease-packages
from last successful run where branch is namedv0.0.0
(with actual version) using this community GitHub Actiondawidd6/action-download-artifact
.Other considerations
Why not use latest successful CI run for
main
?There would be a race condition since by the time the release PR gets merged and
main
finishes running, this npm workflow would already have run, so the last successful CI run formain
wouldn't be 1:1 with the release branch merge commit.Why not use the same branch name each time like
release
?@vapurrmaid and @code-asher brought up a good point. If we do this, then we have no way to differentiate between a 4.1.0 and a 4.2.0 release workflow since they both use the same branch name. This is important because there are times we need to republish releases like on Docker and we'd want to use the same build.
Testing Plan
cdr/code-server
main
release
npm-brew
runs and download-artifact works as expected: https://github.com/jsjoeio/code-server/runs/5562662740?check_suite_focus=true#step:3:16Fixes #4949